package org.iteam.xlz.manager.action.sys;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.iteam.web.struts.action.AbstractModuleAction;
import org.iteam.web.struts.action.RestAction;
import org.iteam.xlz.core.entity.log.LogCreator;
import org.iteam.xlz.core.service.LogCreatorService;

@SuppressWarnings("unchecked")
@Results({
		@Result(type = "freemarker", name = "INDEX", location = "/WEB-INF/content/sys/log/index.html")})
public class SysLogAction extends AbstractModuleAction<LogCreator> implements RestAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 5670854281065158087L;
	private final String PATH="/sys/log";
	
	@Override
	@Action(PATH+"/index")
	public String index() throws Exception {
		return INDEX;
	}

	@Override
	@Action(PATH+"/query")
	public String query() {
		map.put("total",LogCreatorService.getInstance().counts());
		map.put("rows",LogCreatorService.getInstance().query(page,rows));
		return MAP;
	}

	@Override
	public String show() {
		return null;
	}

	@Override
	public String create() {
		return null;
	}

	@Override
	public String update() {
		return null;
	}

	@Override
	public String delete() {
		return null;
	}

	@Override
	public String destroy() {
		return null;
	}

	@Override
	public String edit() throws Exception {
		return null;
	}

	@Override
	public String editNew() throws Exception {
		return null;
	}

	@Override
	public LogCreator getModel() {
		if(null==model){
			model=new LogCreator();
		}
		return model;
	}

}
